Skip to content

Wire QSWATPlusRefHAWQS and QSWATPlusProjHAWQS into database initialisation and validation#1

Draft
Copilot wants to merge 94 commits intomasterfrom
copilot/develop-r-package-for-qgis-plugin
Draft

Wire QSWATPlusRefHAWQS and QSWATPlusProjHAWQS into database initialisation and validation#1
Copilot wants to merge 94 commits intomasterfrom
copilot/develop-r-package-for-qgis-plugin

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 25, 2026

  • Understand repo structure
  • Track cell indices in qswat_create_hrus() to enable raster→polygon conversion
  • Add .build_hru_sf() helper: builds HRU ID raster and vectorises to sf polygons with attributes
  • Add .build_lsu_sf() helper: vectorises watershed raster (subbasins ≡ LSUs in rQSWATPlus) to sf
  • Store project$hru_sf and project$lsu_sf at end of qswat_create_hrus()
  • Update @return docs for qswat_create_hrus()
  • Add qswat_plot_hrus() — spatial map of HRUs coloured by attribute
  • Add qswat_plot_lsus() — spatial map of LSU/subbasin polygons
  • Add qswat_plot_overview() — combined overlay: DEM, landuse, soil, LSU, HRU, streams, outlets
  • Export all three new functions in NAMESPACE

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 26, 2026 00:24
…xample data

Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/bbb403e8-ecbf-40c2-a367-81298d591a8d
Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/bbb403e8-ecbf-40c2-a367-81298d591a8d
Copilot AI changed the title [WIP] Add R package for QGIS plugin replication with vignettes Add rQSWATPlus R package replicating QSWATPlus QGIS plugin workflow Mar 26, 2026
Copilot AI requested a review from tadhg-moore March 26, 2026 00:26
@tadhg-moore
Copy link
Copy Markdown
Collaborator

Can @copilot add visualisation functions to allow the user to inspect the outputs as spatial objects using the tmap R package, and also summary plots showing landuse, soils, and hru breakdown.

Copilot AI and others added 2 commits March 26, 2026 01:53
…compatibility checks

Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/eb2274fe-4395-4d4e-840a-fd391d878047
Copy link
Copy Markdown
Author

Copilot AI commented Mar 26, 2026

Can @copilot add visualisation functions to allow the user to inspect the outputs as spatial objects using the tmap R package, and also summary plots showing landuse, soils, and hru br...

Added in commit bc49f51:

Spatial map functions using tmap (Suggests dependency):

  • qswat_plot_dem() — DEM elevation map
  • qswat_plot_landuse() — Land use classification with lookup labels
  • qswat_plot_soil() — Soil type with lookup labels
  • qswat_plot_streams() — Stream network overlaid on DEM
  • qswat_plot_watershed() — Subbasin boundaries

Summary plots using ggplot2 (Suggests dependency):

  • qswat_plot_landuse_summary() — Bar chart of land use area/percent
  • qswat_plot_soil_summary() — Bar chart of soil area/percent
  • qswat_plot_hru_summary() — Faceted land use/soil/slope breakdown, or stacked bar per subbasin with by_subbasin = TRUE

Both tmap and ggplot2 are in Suggests so the core package works without them, with clear error messages if missing. 14 new tests cover the visualization functions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.r-project.org
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --no-restore --no-echo --args nextArgrQSWATPlusnextArg--no-build-vignettesnextArg--no-manual -pocketsphinx-en-us_0.8.0&#43;real5porg.freedesktop.DBus.Properties.Get stall-Rt0rH4/922-r-cran-systemfistring:org.freedesktop.login1.Manager /usr/bin/tar stall-Rt0rH4/723rm p.ci plit tar -x l.service.wants p.ci /usr/bin/dpkg-deb .deb stall-Rt0rH4/736--norc /usr/bin/tar dpkg-deb (dns block)
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --no-restore --no-echo --args nextArgrQSWATPlusnextArg--no-build-vignettesnextArg--no-manual (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add rQSWATPlus R package replicating QSWATPlus QGIS plugin workflow Match database output to QSWATPlusProj.sqlite template for SWAT+ Editor compatibility Mar 26, 2026
Copilot AI and others added 2 commits April 8, 2026 02:51
…ers options to qswat_create_hrus

Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/2d800782-b590-40e9-bf62-e1f6f198afeb

Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
tadhg-moore and others added 22 commits April 8, 2026 16:07
… population

Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/b7944146-d389-458f-8c67-111a1b2723ee

Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
…-in-r

Implement qswat_populate_gwflow_gis() for GIS-dependent gwflow tables
…ow-tables-in-r

Revert "Implement qswat_populate_gwflow_gis() for GIS-dependent gwflow tables"
Integrate gwflow setup into qswat_run workflow
…ow-tables-in-r

Revert 2 copilot/implement gwflow tables in r
…rucell) in qswat_setup_gwflow

Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/ea09f8d7-35da-45fc-8a17-768308f7ddc5

Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
…t, recharge condition)

Agent-Logs-Url: https://github.com/limnotrack/QSWATPlus/sessions/ea09f8d7-35da-45fc-8a17-768308f7ddc5

Co-authored-by: tadhg-moore <23136262+tadhg-moore@users.noreply.github.com>
…base-function

Copilot/update qswat check database function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants